package com.example.softwareengg;

 
import android.os.Bundle;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.view.Menu;
 
public class MainActivity extends Activity {
 
    private static final int NOTIFY_ME_ID = 1987;
 
    private NotificationManager mgr = null;
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        mgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        initializeUIElements();
    }
 
    private void initializeUIElements() {
 
        Notification note = new Notification(R.drawable.comment,
                "Welcome to WiShare", System.currentTimeMillis());
        PendingIntent i = PendingIntent.getActivity(this, 0, new Intent(
                this, MainActivity.class), Notification.FLAG_ONGOING_EVENT);
 
        note.setLatestEventInfo(this, "WiShare", "Helps you connect",
                i);
        // note.number = ++count;
        note.flags |= Notification.FLAG_ONGOING_EVENT;
 
        mgr.notify(NOTIFY_ME_ID, note);
 
    }
 
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}